package com.rbac.admin.vo.system;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 部门视图对象
 *
 * @author rbac-admin
 * @since 2024-07-18
 */
@Data
@Schema(description = "部门视图对象")
public class DeptVO {
    
    @Schema(description = "部门ID")
    private Integer id;
    
    @Schema(description = "部门名称")
    private String deptName;
    
    @Schema(description = "部门名称（前端兼容字段）")
    @JsonProperty("name")
    public String getName() {
        return this.deptName;
    }
    
    @Schema(description = "部门编码")
    private String deptCode;
    
    @Schema(description = "父部门ID")
    private Integer parentId;
    
    @Schema(description = "父部门名称")
    private String parentName;
    
    @Schema(description = "显示顺序")
    private Integer orderNum;
    
    @Schema(description = "负责人ID")
    private String leaderId;
    
    @Schema(description = "负责人姓名")
    private String leaderName;
    
    @Schema(description = "联系电话")
    private String phone;
    
    @Schema(description = "邮箱")
    private String email;
    
    @Schema(description = "部门状态（0-停用，1-正常）")
    private Integer status;
    
    @Schema(description = "创建时间")
    private LocalDateTime createTime;
    
    @Schema(description = "更新时间")
    private LocalDateTime updateTime;
    
    @Schema(description = "备注")
    private String remark;
    
    @Schema(description = "是否为主部门（0-否，1-是）")
    private Integer isMain;
    
    @Schema(description = "子部门列表")
    private List<DeptVO> children;
}